﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls">

    <Style x:Key="ControlNavigatorButtonPrevious" TargetType="{x:Type Button}">
        <Setter Property="Width" Value="17"/>
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Ellipse x:Name="ButtonBackground" Fill="{DynamicResource BrushNavigatorButtonBackground}"/>
                        <Path x:Name="ButtonIcon" Stretch="Fill" Stroke="{x:Null}" Margin="5.824,3.37,1.918,4.371" RenderTransformOrigin="0.499999993185416,0.49999998843193" Data="M0,0 L7.7940002,0 7.7940002,0.02878453 0.027784619,7.795 0,7.795 0,0 z" Fill="{DynamicResource BrushNavigatorButtonIconPreviousBackground}">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="-45"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundHover}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundPressed}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundDisabled}" TargetName="ButtonBackground"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonIconBackgroundDisabled}" TargetName="ButtonIcon"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlNavigatorButtonNext" TargetType="{x:Type Button}">
        <Setter Property="Width" Value="17"/>
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Ellipse x:Name="ButtonBackground" Fill="{DynamicResource BrushNavigatorButtonBackground}"/>
                        <Path Stretch="Fill" Margin="2.324,3.37,5.418,4.371" x:Name="ButtonIcon" RenderTransformOrigin="0.499999993185416,0.49999998843193" Data="M0,0 L7.7940002,0 7.7940002,0.02878453 0.027784619,7.795 0,7.795 0,0 z" Fill="{DynamicResource BrushNavigatorButtonIconNextBackground}">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="-1" ScaleY="1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="45"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundHover}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundPressed}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundDisabled}" TargetName="ButtonBackground"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonIconBackgroundDisabled}" TargetName="ButtonIcon"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlNavigatorButtonFirst" TargetType="{x:Type Button}">
        <Setter Property="Width" Value="17"/>
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Ellipse Stroke="{x:Null}" x:Name="ButtonBackground" Fill="{DynamicResource BrushNavigatorButtonBackground}"/>
                        <Path Stretch="Fill" Stroke="{x:Null}" Margin="4.074,5.62,3.668,2.121" x:Name="ButtonIcon" RenderTransformOrigin="0.499999993185416,0.49999998843193" Data="M0,0 L7.7940002,0 7.7940002,0.02878453 0.027784619,7.795 0,7.795 0,0 z" Fill="{DynamicResource BrushNavigatorButtonIconFirstBackground}">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="45"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundHover}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundPressed}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundDisabled}" TargetName="ButtonBackground"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonIconBackgroundDisabled}" TargetName="ButtonIcon"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlNavigatorButtonLast" TargetType="{x:Type Button}">
        <Setter Property="Width" Value="17"/>
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Ellipse x:Name="ButtonBackground" Fill="{DynamicResource BrushNavigatorButtonBackground}"/>
                        <Path Stretch="Fill" Stroke="{x:Null}" Margin="4.074,1.12,3.668,6.621" x:Name="ButtonIcon" RenderTransformOrigin="0.499999993185416,0.49999998843193" Data="M0,0 L7.7940002,0 7.7940002,0.02878453 0.027784619,7.795 0,7.795 0,0 z" Fill="{DynamicResource BrushNavigatorButtonIconLastBackground}">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="-1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="-45"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundHover}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundPressed}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundDisabled}" TargetName="ButtonBackground"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonIconBackgroundDisabled}" TargetName="ButtonIcon"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlNavigatorButtonPin" TargetType="{x:Type Button}">
        <Setter Property="Width" Value="17"/>
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Ellipse x:Name="ButtonBackground" Fill="{DynamicResource BrushNavigatorButtonBackground}"/>
                        <Path Stretch="Fill" x:Name="ButtonIcon1" Stroke="{x:Null}" Margin="1.784,3.734,2.049,4.266" Data="M4.459,0 L6.627,0 C6.8335545,0 7.001,0.16744542 7.0009999,0.37399995 L7.0009999,1.0829998 12.792,1.0829998 C12.999107,1.0829999 13.167,1.2508932 13.167,1.4579998 L13.167,7.5410001 C13.167,7.7481067 12.999107,7.9160001 12.792,7.9160001 L7.0009999,7.9160001 L7.0009999,8.6260002 C7.001,8.8325546 6.8335545,8.9999998 6.627,8.9999998 L4.459,8.9999998 C4.2524455,8.9999998 4.085,8.8325546 4.085,8.6260002 L4.085,6.1249998 L0.41599989,6.1249998 C0.18624973,6.1249998 0,5.9387505 0,5.7089999 L0,3.2909999 C0,3.0612495 0.18624973,2.875 0.41599989,2.875 L4.085,2.875 L4.085,0.37399995 C4.085,0.16744542 4.2524455,0 4.459,0 z" Fill="{DynamicResource BrushNavigatorButtonPinIconBackground}"/>
                        <Rectangle x:Name="ButtonIcon2" Stroke="{x:Null}" RadiusX="0.417" RadiusY="0.417" Margin="7.784,6.525,3.966,8.224" Fill="{DynamicResource BrushNavigatorButtonPinRectangleBackground}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundHover}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundPressed}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundDisabled}" TargetName="ButtonBackground"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorIconPinBackgroundDisabledDark}" TargetName="ButtonIcon1"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorIconBackgroundDisabledLight}" TargetName="ButtonIcon2"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlNavigatorButtonSearch" TargetType="{x:Type Button}">
        <Setter Property="Width" Value="17"/>
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Ellipse x:Name="ButtonBackground" Fill="{DynamicResource BrushNavigatorButtonBackground}"/>
                        <Ellipse x:Name="ButtonIcon1" Stroke="{DynamicResource BrushNavigatorIconSearchBorder}" Margin="2.535,1.858,5.215,5.892" Fill="{DynamicResource BrushNavigatorButtonSearchEllipseBackground}"/>
                        <Rectangle x:Name="ButtonIcon2" Fill="{DynamicResource BrushNavigatorIconSearchBackground}" Stroke="{DynamicResource BrushNavigatorIconSearchBorder}" RadiusX="0" RadiusY="0" HorizontalAlignment="Right" Margin="0,0,2.67,4.335" VerticalAlignment="Bottom" Width="5.544" Height="2.16" RenderTransformOrigin="0.5,0.5">
                            <Rectangle.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="49.449"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Rectangle.RenderTransform>
                        </Rectangle>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundHover}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundPressed}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundDisabled}" TargetName="ButtonBackground"/>
                            <Setter Property="Stroke" Value="{DynamicResource BrushNavigatorIconBackgroundDisabledDark}" TargetName="ButtonIcon1"/>
                            <Setter Property="Stroke" Value="{DynamicResource BrushNavigatorIconBackgroundDisabledDark}" TargetName="ButtonIcon2"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlNavigatorButtonDisplayList" TargetType="{x:Type ToggleButton}">
        <Setter Property="Width" Value="17"/>
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid>
                        <Ellipse x:Name="ButtonBackground" Fill="{DynamicResource BrushNavigatorButtonBackground}"/>
                        <Rectangle x:Name="ButtonIcon1" Stroke="{DynamicResource BrushNavigatorIconDisplayListBorder}" Margin="3.695,2.907,3.721,2.926" Fill="{DynamicResource BrushNavigatorIconDisplayListBackground1}"/>
                        <Rectangle x:Name="ButtonIcon2" Fill="{DynamicResource BrushNavigatorIconDisplayListBackground2}" Stroke="{x:Null}" Margin="4.541,5.728,4.469,0" VerticalAlignment="Top" Height="1"/>
                        <Rectangle x:Name="ButtonIcon3" Fill="{DynamicResource BrushNavigatorIconDisplayListBackground3}" Stroke="{x:Null}" Margin="4.541,0,4.469,6.381" VerticalAlignment="Bottom" Height="1"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundHover}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundPressed}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorToggleButtonChecked}" TargetName="ButtonBackground"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundDisabled}" TargetName="ButtonBackground"/>
                            <Setter Property="Stroke" Value="{DynamicResource BrushNavigatorIconBackgroundDisabledDark}" TargetName="ButtonIcon1"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorIconBackgroundDisabledDark}" TargetName="ButtonIcon2"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorIconBackgroundDisabledDark}" TargetName="ButtonIcon3"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Controls:SinacorNavigator}">
        <Style.Resources>
            <Controls:PositiveToNegativeConverter x:Key="positiveToNegativeConverter"></Controls:PositiveToNegativeConverter>
        </Style.Resources>
        <Setter Property="IsSynchronizedWithCurrentItem" Value="True"/>
        <Setter Property="Height" Value="24"/>
        <Setter Property="Width" Value="300"/>
        <Setter Property="Panel.ZIndex" Value="999"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:SinacorNavigator}">
                    <Grid >
                        <!--Height está fixo como 24 para evitar problemas caso o height do SinacorNavigator seja setado de forma indevida pelo desenvolvedor-->
                        <Canvas Width="{TemplateBinding Width}" Height="24" >
                            <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled">
                                <Border Canvas.Top="0" x:Name="PART_NavigationBar" CornerRadius="10" Width="{TemplateBinding Width}" BorderBrush="{DynamicResource BrushNavigatorBorder}" BorderThickness="1,1,1,1" Height="24" Background="{DynamicResource BrushNavigatorBackground}">
                                    <StackPanel Orientation="Horizontal" Margin="5,2.804,0,1.493" HorizontalAlignment="Center">
                                        <Button HorizontalAlignment="Left" x:Name="BotaoEsquerdo" Command="Controls:SinacorNavigatorCommands.NavigateToPrevious" Style="{DynamicResource ControlNavigatorButtonPrevious}" Width="17" ToolTip="{DynamicResource Infra.Controls.Label.ItemAnterior}"/>
                                        <Button HorizontalAlignment="Left" Margin="15,0,0,0" x:Name="BotaoDireito" Command="Controls:SinacorNavigatorCommands.NavigateToNext" Style="{DynamicResource ControlNavigatorButtonNext}" ToolTip="{DynamicResource Infra.Controls.Label.ProximoItem}"/>
                                        <Grid HorizontalAlignment="Left" Margin="15,0,0,0" x:Name="GridPaginacao" Width="63">
                                            <Rectangle RadiusX="4.666" RadiusY="4.666" Width="63" x:Name="Pagination" Fill="{DynamicResource BrushNavigatorButtonBackground}"/>
                                            <StackPanel Orientation="Horizontal" Width="63">
                                                <Controls:SinacorInt32TextBox x:Name="PART_TxtPosition" IsFormated="False" CausesValidation="False" Integers="4" Value="{Binding Path=Position, RelativeSource={RelativeSource TemplatedParent}}" Width="30" ToolTip="{DynamicResource Infra.Controls.Label.ItemAtual}"/>
                                                <Controls:SinacorLabel Content="/"/>
                                                <Controls:SinacorLabel Margin="1.9,1,0,0" Content="{Binding Path=Items.Count, RelativeSource={RelativeSource TemplatedParent}}" ToolTip="{DynamicResource Infra.Controls.Label.TotalItens}"/>
                                            </StackPanel>
                                        </Grid>
                                        <Button x:Name="BotaoCima" Margin="15,0,0,0" Command="Controls:SinacorNavigatorCommands.NavigateToFirst" Style="{DynamicResource ControlNavigatorButtonFirst}"  ToolTip="{DynamicResource Infra.Controls.Label.PrimeiroItem}"/>
                                        <Button HorizontalAlignment="Right" Margin="15,0,0,0" x:Name="BotaoBaixo" Command="Controls:SinacorNavigatorCommands.NavigateToLast" Style="{DynamicResource ControlNavigatorButtonLast}" ToolTip="{DynamicResource Infra.Controls.Label.UltimoItem}"/>
                                        <!--As funcionalidades abaixo ainda não estão implementadas-->
                                        <!--<Button HorizontalAlignment="Right" Margin="15,0,0,0" x:Name="BotaoPin" Style="{DynamicResource ControlNavigatorButtonPin}"/>
                                <Button HorizontalAlignment="Right" Margin="15,0,0,0" x:Name="BotaoLupa" Style="{DynamicResource ControlNavigatorButtonSearch}"/>-->
                                        <ToggleButton HorizontalAlignment="Right" Margin="15,0,0,0" x:Name="btnDisplayPopup" Command="Controls:SinacorNavigatorCommands.DisplayPopup" Style="{DynamicResource ControlNavigatorButtonDisplayList}" ToolTip="{DynamicResource Infra.Controls.Label.ListaItens}"/>
                                    </StackPanel>
                                </Border>
                            </ScrollViewer>
                            <Grid x:Name="PART_Popup" MinHeight="40" MaxHeight="{TemplateBinding MaxPopupHeight}" Width="{TemplateBinding ActualWidthPopup}" MaxWidth="{TemplateBinding ActualWidthPopup}" Visibility="Collapsed" >
                                <ListBox x:Name="PART_ListBox" SelectionMode="{Binding Path=SelectionMode, RelativeSource={RelativeSource TemplatedParent}}" SelectedIndex="{Binding Path=SelectedIndex, RelativeSource={RelativeSource TemplatedParent}}" ItemsSource="{TemplateBinding ItemsSource}" ItemTemplate="{TemplateBinding ItemTemplate}" Margin="15,0">
                                    <ListBox.Style>
                                        <Style TargetType="ListBox">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="ListBox">
                                                        <Grid>
                                                            <Border Background="Transparent"/>
                                                            <Border CornerRadius="6,6,0,0" BorderBrush="{DynamicResource BrushNavigatorPopupBorder}" x:Name="BorderListBox" Background="{DynamicResource BrushNavigatorListBoxBackground}">
                                                                <Controls:SinacorScrollViewer x:Name="PART_ScrollItems" ScrollViewer.VerticalScrollBarVisibility="Auto" CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,8,0,8">
                                                                    <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                                                </Controls:SinacorScrollViewer>
                                                            </Border>
                                                        </Grid>
                                                        <ControlTemplate.Triggers>
                                                            
                                                            <MultiDataTrigger>
                                                                <MultiDataTrigger.Conditions>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=NavigatorPlacement}"  Value="Bottom"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=AlignmentPopup}"  Value="Left"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=CanvasOnPopup}"  Value="True"/>
                                                                </MultiDataTrigger.Conditions>
                                                                <Setter Property="CornerRadius" Value="6,6,6,0" TargetName="BorderListBox"/>
                                                            </MultiDataTrigger>
                                                            
                                                            <MultiDataTrigger>
                                                                <MultiDataTrigger.Conditions>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=NavigatorPlacement}"  Value="Bottom"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=AlignmentPopup}"  Value="Right"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=CanvasOnPopup}"  Value="True"/>
                                                                </MultiDataTrigger.Conditions>
                                                                <Setter Property="CornerRadius" Value="6,6,0,6" TargetName="BorderListBox"/>
                                                            </MultiDataTrigger>

                                                            <MultiDataTrigger>
                                                                <MultiDataTrigger.Conditions>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=NavigatorPlacement}"  Value="Top"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=AlignmentPopup}"  Value="Left"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=CanvasOnPopup}"  Value="True"/>
                                                                </MultiDataTrigger.Conditions>
                                                                <Setter Property="CornerRadius" Value="0,6,6,6" TargetName="BorderListBox"/>
                                                            </MultiDataTrigger>
                                                            
                                                            <MultiDataTrigger>
                                                                <MultiDataTrigger.Conditions>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=NavigatorPlacement}"  Value="Top"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=AlignmentPopup}"  Value="Right"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=CanvasOnPopup}"  Value="True"/>
                                                                </MultiDataTrigger.Conditions>
                                                                <Setter Property="CornerRadius" Value="6,0,6,6" TargetName="BorderListBox"/>
                                                            </MultiDataTrigger>

                                                            <MultiDataTrigger>
                                                                <MultiDataTrigger.Conditions>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=NavigatorPlacement}"  Value="Bottom"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=AlignmentPopup}"  Value="Left"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=CanvasOnPopup}"  Value="False"/>
                                                                </MultiDataTrigger.Conditions>
                                                                <Setter Property="CornerRadius" Value="6,6,0,0" TargetName="BorderListBox"/>
                                                            </MultiDataTrigger>

                                                            <MultiDataTrigger>
                                                                <MultiDataTrigger.Conditions>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=NavigatorPlacement}"  Value="Bottom"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=AlignmentPopup}"  Value="Right"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=CanvasOnPopup}"  Value="False"/>
                                                                </MultiDataTrigger.Conditions>
                                                                <Setter Property="CornerRadius" Value="6,6,0,0" TargetName="BorderListBox"/>
                                                            </MultiDataTrigger>

                                                            <MultiDataTrigger>
                                                                <MultiDataTrigger.Conditions>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=NavigatorPlacement}"  Value="Top"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=AlignmentPopup}"  Value="Left"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=CanvasOnPopup}"  Value="False"/>
                                                                </MultiDataTrigger.Conditions>
                                                                <Setter Property="CornerRadius" Value="0,0,6,6" TargetName="BorderListBox"/>
                                                            </MultiDataTrigger>
                                                            
                                                            <MultiDataTrigger>
                                                                <MultiDataTrigger.Conditions>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=NavigatorPlacement}"  Value="Top"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=AlignmentPopup}"  Value="Right"/>
                                                                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:SinacorNavigator}}, Path=CanvasOnPopup}"  Value="False"/>
                                                                </MultiDataTrigger.Conditions>
                                                                <Setter Property="CornerRadius" Value="0,0,6,6" TargetName="BorderListBox"/>
                                                            </MultiDataTrigger>

                                                        </ControlTemplate.Triggers>
                                                  </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                    </Style>
                                    </ListBox.Style>
                                    <ListBox.ItemContainerStyle>
                                        <Style TargetType="ListBoxItem">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="ListBoxItem">
                                                        <Border x:Name="ItemBorder" Margin="5,3" CornerRadius="8.833" BorderThickness="1" BorderBrush="Transparent">
                                                            <ContentPresenter Margin="3,5" TextElement.Foreground="{DynamicResource BrushNavigatorControlsForeground}"/>
                                                        </Border>
                                                        <ControlTemplate.Triggers>
                                                            <Trigger Property="IsFocused" Value="True">
                                                                <Setter Property="BorderBrush" Value="{DynamicResource BrushNavigatorPopupBorderHover}" TargetName="ItemBorder"/>
                                                                <Setter Property="Background" Value="{DynamicResource BrushNavigatorListBoxItemBackgroundHover}" TargetName="ItemBorder"/>
                                                            </Trigger>
                                                            <Trigger Property="IsMouseOver" Value="True">
                                                                <Setter Property="BorderBrush" Value="{DynamicResource BrushNavigatorPopupBorderHover}" TargetName="ItemBorder"/>
                                                                <Setter Property="Background" Value="{DynamicResource BrushNavigatorListBoxItemBackgroundHover}" TargetName="ItemBorder"/>
                                                            </Trigger>

                                                            <Trigger Property="IsSelected" Value="True">
                                                                <Setter Property="BorderBrush" Value="{DynamicResource BrushNavigatorPopupBorderSelected}" TargetName="ItemBorder"/>
                                                                <Setter Property="Background" Value="{DynamicResource BrushNavigatorListBoxItemBackgroundSelected}" TargetName="ItemBorder"/>
                                                            </Trigger>
                                                            <MultiTrigger>
                                                                <MultiTrigger.Conditions>
                                                                    <Condition Property="IsSelected" Value="True"/>
                                                                    <Condition Property="IsFocused" Value="True"/>
                                                                </MultiTrigger.Conditions>
                                                                <Setter Property="BorderBrush" Value="{DynamicResource BrushNavigatorPopupBorderHover}" TargetName="ItemBorder"/>
                                                                <Setter Property="Background" Value="{DynamicResource BrushNavigatorListBoxItemBackgroundSelected}" TargetName="ItemBorder"/>
                                                            </MultiTrigger>
                                                            <MultiTrigger>
                                                                <MultiTrigger.Conditions>
                                                                    <Condition Property="IsSelected" Value="True"/>
                                                                    <Condition Property="IsMouseOver" Value="True"/>
                                                                </MultiTrigger.Conditions>
                                                                <Setter Property="BorderBrush" Value="{DynamicResource BrushNavigatorPopupBorderHover}" TargetName="ItemBorder"/>
                                                                <Setter Property="Background" Value="{DynamicResource BrushNavigatorListBoxItemBackgroundSelected}" TargetName="ItemBorder"/>
                                                            </MultiTrigger>
                                                        </ControlTemplate.Triggers>
                                                        <ControlTemplate.Resources>
                                                            <Style TargetType="{x:Type Controls:SinacorLabel}">
                                                                <Setter Property="Template" Value="{DynamicResource ControlLabel}"/>
                                                                <Setter Property="Foreground" Value="{DynamicResource BrushNavigatorControlsForeground}"/>
                                                            </Style>
                                                            <Style TargetType="{x:Type Controls:SinacorCheckBox}">
                                                                <Setter Property="Template" Value="{DynamicResource ControlCheckBox}"/>
                                                                <Setter Property="Foreground" Value="{DynamicResource BrushNavigatorControlsForeground}"/>
                                                            </Style>
                                                            <Style TargetType="{x:Type Controls:SinacorRadioButton}">
                                                                <Setter Property="Template" Value="{DynamicResource ControlRadioButton}"/>
                                                                <Setter Property="Foreground" Value="{DynamicResource BrushNavigatorControlsForeground}"/>
                                                            </Style>
                                                        </ControlTemplate.Resources>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </ListBox.ItemContainerStyle>
                                </ListBox>
                            </Grid>
                        </Canvas>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="AlignmentPopup" Value="Left">
                            <Setter Property="Canvas.Left" TargetName="PART_Popup" Value="0"></Setter>
                        </Trigger>

                        <Trigger Property="AlignmentPopup" Value="Right">
                            <Setter Property="Canvas.Right" TargetName="PART_Popup" Value="0"></Setter>
                        </Trigger>

                        <DataTrigger Binding="{Binding Path=HasItems, RelativeSource={x:Static RelativeSource.Self}}" Value="False">
                            <Setter Property="IsEnabled" Value="False"/>
                        </DataTrigger>
                        <!--Caso o controle esteja configurado para abrira popup para cima(barra de navegacao na parte de baixo)-->
                        <Trigger Property="NavigatorPlacement" Value="Bottom">
                            <!--Posicionar a popup acima da barra de navegacao-->
                            <Setter Property="Canvas.Top" TargetName="PART_Popup" Value="{Binding ElementName=PART_Popup,Path=ActualHeight,Converter={StaticResource positiveToNegativeConverter}}"></Setter>
                        </Trigger>

                        <!--Caso o controle esteja configurado para abrira popup para baixo(barra de navegacao na parte de cima)-->
                        <Trigger Property="NavigatorPlacement" Value="Top">
                            <!--Posicionar a popup abaixo da barra de navegacao-->
                            <Setter Property="Canvas.Top" TargetName="PART_Popup" Value="{Binding ElementName=PART_NavigationBar,Path=Height}"></Setter>
                        </Trigger>
                        
                        <Trigger Property="IsChecked" Value="True" SourceName="btnDisplayPopup">
                            <Setter Property="Visibility" Value="Visible" TargetName="PART_Popup"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="{DynamicResource BrushNavigatorBackgroundDisabled}" TargetName="PART_NavigationBar"/>
                            <Setter Property="BorderBrush" Value="{DynamicResource BrushNavigatorBorderDisabled}" TargetName="PART_NavigationBar"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushNavigatorButtonBackgroundDisabled}" TargetName="Pagination"/>
                            <Setter Property="Height" Value="24"/>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="PART_Popup"/>
                            <Setter Property="IsChecked" Value="False" TargetName="btnDisplayPopup"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                    <ControlTemplate.Resources>

                        <Style TargetType="{x:Type Controls:SinacorInt32TextBox}">
                            <Setter Property="BorderBrush" Value="Transparent"/>
                            <Setter Property="FontFamily" Value="Tahoma"/>
                            <Setter Property="FontSize" Value="11"/>
                            <Setter Property="FontWeight" Value="Normal"/>
                            <Setter Property="FontStyle" Value="Normal"/>
                            <Setter Property="TextAlignment" Value="Right"/>
                            <Setter Property="Foreground" Value="{DynamicResource BrushNavigatorForeground}"/>
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type Controls:SinacorInt32TextBox}">
                                        <Border VerticalAlignment="Stretch">
                                            <ScrollViewer x:Name="PART_ContentHost" Margin="0,1,-2.5,0" VerticalAlignment="Stretch"/>
                                        </Border>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Foreground" Value="{DynamicResource BrushNavigatorForegroundDisabled}"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                        <Style TargetType="{x:Type Controls:SinacorLabel}">
                            <Setter Property="BorderBrush" Value="Transparent"/>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="Padding" Value="0"/>
                            <Setter Property="Foreground" Value="{DynamicResource BrushNavigatorForeground}"/>
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type Controls:SinacorLabel}">
                                        <Border HorizontalAlignment="Stretch">
                                            <ContentPresenter VerticalAlignment="Center" Style="{DynamicResource ControlFont}"/>
                                        </Border>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Foreground" Value="{DynamicResource BrushNavigatorForegroundDisabled}"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </ControlTemplate.Resources>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--END NAVIGATOR-->
</ResourceDictionary>